package com.pcbly.web.job;

import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.scheduling.quartz.QuartzJobBean;

import com.pcbly.web.bean.mail.UserMailBean;
import com.pcbly.web.business.mail.UserMailService;

public class CheckEmailDownloadJob extends QuartzJobBean {
	private static Log log=LogFactory.getLog(CheckEmailDownloadJob.class);
    private long interval;
    private UserMailService userMailService;
    private List<UserMailBean> list;
    
    public List<UserMailBean> getList() {
		return list;
	}
	public void setList(List<UserMailBean> list) {
		this.list = list;
	}
	public CheckEmailDownloadJob(){
    	interval= Time.MINUTE;
    }
    private void init()throws Exception{
    	log.info("init()...start..................");
    	list=userMailService.getUserMailBeans();
    	log.info("init()...end..................");
    }
	@Override
	protected void executeInternal(JobExecutionContext arg0)
			throws JobExecutionException {
		// TODO Auto-generated method stub
		try{
			init();
			
		}catch(Exception e){
			log.error(e.getMessage());
		}
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}
	public void setUserMailService(UserMailService userMailService) {
		this.userMailService = userMailService;
	}

}
